import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
/*   {
    title: '客户名称',
    align:"center",
    dataIndex: 'name'
   },*/
  {
    title: '客户名称',
    align:"center",
    dataIndex: 'customId_dictText'
  },
   {
    title: '项目',
    align:"center",
    dataIndex: 'projectId_dictText'
   },
   {
    title: '合同金额',
    align:"center",
    dataIndex: 'amount'
   },
  {
    title: '是否含税',
    align:"center",
    dataIndex: 'faxStatus_dictText'
  },
   {
    title: '合同状态',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '回款状态',
    align:"center",
    dataIndex: 'returnMoneyStatus_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
    label: '项目',
    colProps: { span: 4 },
  },
  {
    field: 'customId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_custom,name,id'
    },
    label: '客户',
    colProps: { span: 4 },
  },
  {
    label: '合同状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'contractStatus',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },
/*  {
    label: '回款状态',
    field: 'returnMoneyStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'returnMoneyStatus',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },*/
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    field: 'customId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_custom,name,id'
    },
    label: '客户',
  },

  {
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
    label: '项目',
  },

  {
    label: '合同金额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '是否含税',
    field: 'faxStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'faxStatus',
      stringToNumber: true,
    },
  },
  {
    label: '合同状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'contractStatus',
      stringToNumber: true,
    },
  },
  {
    label: '回款状态',
    field: 'returnMoneyStatus',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'returnMoneyStatus',
      stringToNumber: true,
    },
  },
  {
    field: 'uploadFile',
    component: 'JUpload',
    helpMessage: '附件上传',
    label: '附件上传',
    componentProps:{
      returnUrl: false
    }
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
